package com.ljw.punishment.rulesengine;

/**
 * @author lijunwei
 * @date 2025/5/21
 */
public enum EngineTypeEnum {

    DEFAULT_RULE_ENGINE(0, "默认执行引擎，按照优先级顺序执行引擎"),
    INTERFACE_RULE_ENGINE(1, "应用所有规则");

    private Integer code;
    private String desc;

    EngineTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static EngineTypeEnum getEngineTypeByCode(Integer code) {
        if (code == null) {
            return null;
        }

        for (EngineTypeEnum value : EngineTypeEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }

        return null;
    }
}
